package com.example.demo.ws.hzuoj.web;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.example.demo.ws.hzuoj.entity.UserRole;
import com.example.demo.ws.hzuoj.service.UserRoleService;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Controller
@RestController
@RequestMapping("/userRole")
public class UserRoleWeb {


    @Autowired
    UserRoleService userRoleService;
    
    @RequestMapping("/getList")
    public Object getList(Map< String, Object> searchParam,Page page){
    	
    	List<UserRole> userRoles=userRoleService.selectBySeachParam(searchParam,page);
    	
    	Map< String, Object> results=new HashMap<>();
    	results.put("userRoles", userRoles);
    	results.put("page", page);
        return results;
    }
    
    @RequestMapping("/getAllList")
    public Object getAllList(Map< String, Object> searchParam){
    	System.out.println(searchParam);
    	List<UserRole> userRoles=userRoleService.selectBySeachParam(searchParam);
    	Map< String, Object> results=new HashMap<>();
    	results.put("userRoles", userRoles);
        return results;
    }
}
